home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / gfx / vtdevel3.lha / SourceAGA / CopperColor.s < prev    next >
Text File  |  1994-06-27  |  39KB  |  1,870 lines

  1. ;CopperColor
  2.  
  3. rout            ;when this is off, the routine-file will be
  4.             ;assembled, on=testing
  5.             
  6. ;debug            ;when this is on, colors in the background will
  7.             ;show how much time the routine needs.
  8.  
  9. ;ntsctest        ;when this is on, the routineplayer is in ntsc-mode
  10.  
  11. ;ocs            ;off=AGA,on=OCS testing not possible on OCS !
  12.  
  13. routinemode    equ    3    ;the routinemode !
  14.  
  15.  
  16. ; VideoTracker AGA developer source 25-12-93
  17. ; 24-bits colors, Super-HiRes, HAM8, maximum burstmode (64 pixels aligned)
  18. ; wich makes low-resolution overscan a bit ugly.
  19. ; no "interactive" support anymore, it's only used by Kick 1.3 users.
  20.  
  21. ; the first part of the source handles the things that are necessary to
  22. ; show the picture/copper and playing of the routine.
  23. ; the part between the "***" lines is the routine-source.
  24. ; at the bottom of the file, there are the necessary incbin-files who
  25. ; are needed to test the routine.
  26. ; these are saved with "save effect" in videotracker. they are raw
  27. ; data files which can be fonts,pictures,landscapes,vectorobjects
  28. ; etcetra.
  29. ; the incbin-files are put in the "variables" table, in the routine
  30. ; player-handler
  31. ; the place where it's done can be found by searching for "!!!"
  32.  
  33.     opt    a+    ;devpac 3 optimize
  34.     opt    o+
  35.  
  36. vew_wid    equ    48
  37. vew_hgt    equ    290
  38. win_hgt    equ    117
  39. win_str    equ    $1a
  40.  
  41.         ifd    ocs
  42. pic_wid        equ    4        ;wide in bytes
  43. pic_hgt        equ    6        ;hoogte
  44. pic_dpt        equ    8        ;number planes
  45. pic_ani        equ    10        ;aantal effes (anim)
  46. pic_vew        equ    12        ;viewmode
  47. pic_cycstr    equ    14        ;cycle start (*4)
  48. pic_cycend    equ    15        ;cycle end (*4)
  49. pic_cycspd    equ    16        ;cycle speed (*4)
  50. pic_cycadd    equ    17        ;cycle add (*4)
  51. pic_palnum    equ    30        ;aantal kleuren
  52. pic_pal        equ    32        ;palette start
  53. pic_palsiz    equ    256*2        ;vaste palette size
  54. pic_raw        equ    pic_pal+pic_palsiz    ;palette start
  55.         endc
  56.         
  57.         ifnd    ocs
  58. pic_wid        equ    4        ;wide in bytes
  59. pic_hgt        equ    6        ;hoogte
  60. pic_dpt        equ    8        ;number planes
  61. pic_ani        equ    10        ;aantal effes (anim)
  62. pic_vew        equ    12        ;viewmode
  63. pic_cycstr    equ    14        ;cycle start (*8)
  64. pic_cycend    equ    15        ;cycle end (*8)
  65. pic_cycspd    equ    16        ;cycle speed (*8)
  66. pic_cycadd    equ    17        ;cycle add (*8)
  67. pic_widmod    equ    46        ;animation-width modulo
  68. pic_future    equ    50        ;free future space
  69. pic_palnum    equ    62        ;aantal kleuren
  70. pic_pal        equ    64        ;palette start
  71. pic_palsiz    equ    256*4        ;vaste palette size (longwords)
  72. pic_raw        equ    pic_pal+pic_palsiz    ;palette start
  73.         endc
  74.         
  75. var_len        equ    $300        ;lengte vartabel
  76.  
  77. var__GfxBase    equ    $000        ;graphics lib
  78. var_pic1    equ    $004        ;current picture
  79. var_anispd1    equ    $008        ;animspeed
  80. var_anitel1    equ    $00c        ;animcount
  81. var_cprbck    equ    $010        ;copperback
  82. var_bck        equ    $014        ;background
  83. var_pic2    equ    $018        ;current picture
  84. var_ntsc    equ    $01c        ;ntsc/pal frequence
  85. var_lnd        equ    $020        ;landscape
  86. var_anilop1    equ    $024
  87. var_rottrg    equ    $028        ;effect trigger
  88. var_txt1    equ    $040        ;text
  89. var_txt16    equ    15*4+var_txt1
  90. var_vec1    equ    $080        ;vectors
  91. var_vec16    equ    15*4+var_vec1
  92. var_fon1    equ    $0c0        ;fonts
  93. var_fon16    equ    15*4+var_fon1
  94. var_cols1    equ    $100        ;colorsets
  95. var_cols16    equ    15*4+var_cols1
  96. var_obj1    equ    $180        ;objects
  97. var_obj16    equ    15*4+var_obj1
  98.  
  99.     ifd    rout
  100.     ;videotracker routine-test
  101.  
  102.     incdir    "w:include/"
  103.     include    "exec/types.i"
  104.     include    "graphics/gfxbase.i"
  105.     include    "lvo/graphics_lib.i"
  106.     incdir    'videotracker:effect/'
  107.  
  108.     SECTION    1,CODE_C
  109. tus
  110.     lea    var,a0
  111.  
  112. ;    move.l    #rotincobj,var_obj1(a0)    ;incbinfile !!!
  113. ;    move.l    #rotincbck,var_bck(a0)    ;incbinfile !!!
  114. ;    move.l    #rottube,var_vec1(a0)    ;incbinfile !!!
  115. ;    move.l    #rotsrc,curpic1        ;picture !!!
  116. ;    move.l    #rotsrc,curpal1        ;palette !!!
  117.     move.l    #rotset,var_cols1(a0)    ;colorset !!!
  118.  
  119.     bsr    paltabres
  120.  
  121.     move.l    ($4).w,a6
  122.     sub.l    a1,a1
  123.     jsr    -$126(a6)        ;findtask
  124.     move.l    d0,curtsk
  125.     move.l    d0,a0
  126.     move.l    $b8(a0),tskpri
  127.  
  128.     lea    dosnam,a1        ;doslib openen
  129.     moveq.l    #0,d0
  130.     move.l    (4).w,a6
  131.     jsr    -408(a6)        ;openlib
  132.     move.l    d0,doslib
  133.  
  134.     bsr.s    label5            ;videotracker opstarten
  135.     
  136.     move.l    curtsk,a0
  137.     move.l    tskpri,$b8(a0)
  138.     move.l    ($4).w,a6
  139.     jsr    -$84(a6)        ;forbid
  140.  
  141.     move.l    doslib,a1
  142.     move.l    (4).w,a6
  143.     jsr    -414(a6)        ;closelib
  144.  
  145.     moveq.l    #0,d0
  146.     rts
  147.     
  148. label5
  149.     move.l    (4).w,a6        ;workbench gedoe
  150.  
  151.     move.b    530(a6),ntscmode    ;50/60 hertz halen
  152.  
  153.     ifd    ntsctest
  154.     move.b    #60,ntscmode        ;60 hertz (ntsc)
  155.     endc
  156.  
  157.     cmp.b    #50,ntscmode        ;ntsc ?
  158.     beq.s    str.ntsc
  159.     move.l    #vew_hgt-56,hogscr    ;set NTSC screen hight
  160. str.ntsc
  161.  
  162.     lea    cprjmp,a2        ;copjmp zetten !
  163.     move.l    #cprbck-8,d0
  164.     move.w    d0,6(a2)
  165.     swap    d0
  166.     move.w    d0,2(a2)
  167.  
  168.     lea    cprbck-8,a2        ;copstr zetten !
  169.     move.l    #cpr,d0
  170.     move.w    d0,6(a2)
  171.     swap    d0
  172.     move.w    d0,2(a2)
  173.  
  174.     bsr    cprsprrem        ;sprites legen
  175.  
  176.     lea    gfxnam,a1        ;graphics lib openen
  177.     move.l    (4).w,a6
  178.     jsr    -408(a6)        ;openlib
  179.     move.l    d0,a6
  180.     move.l    d0,gfxlib
  181.     move.l    38(a6),oldcprlist
  182.  
  183.     bset    #1,$bfe001
  184.     bsr    copbuf            ;copper vullen
  185.  
  186.     bsr    sysoff
  187.  
  188. gadrun
  189.     btst    #6,($bfe001).l
  190.     bne    gadrun
  191.  
  192. scrend
  193. scrend.play
  194.     bsr    syson
  195.  
  196.     move.l    gfxlib,a1
  197.     move.l    (4).w,a6
  198.     jsr    -414(a6)        ;closelib
  199.  
  200. scrend.qb
  201.     moveq.l    #0,d0    
  202.     rts
  203.     
  204.     ;vertical blank interrupt, no blits.
  205.     ;handles counters,interlace,sprite
  206.     ;level 3
  207.  
  208. intvb
  209.     bra.s    intvb.cnt
  210.     dc.l    'VIDU'
  211.     dc.l    'LOOP'
  212. intvb.cnt
  213.     movem.l    d0-d7/a0-a6,-(sp)
  214.     lea    ($dff000).l,a6
  215.  
  216.     move.w    $01e(a6),d0
  217.     btst    #5,d0            ;vblank ?
  218.     bne.s    intvb.vb
  219.  
  220.     bra.s    intcop.end
  221.  
  222. intvb.vb
  223.     bsr    grap
  224.     bsr    palctr            ;palette zetten
  225.     bsr.s    copbuf            ;copper vullen
  226.     
  227. intvb.end
  228.     move.w    #$0020,$09c(a6)    ;vb bit wissen
  229.     movem.l    (sp)+,d0-d7/a0-a6    ;multitask uit, shit !
  230.     rte
  231.  
  232. intcop.end
  233.     movem.l    (sp)+,d0-d7/a0-a6
  234.     move.l    intvbold,-(sp)
  235.     rts
  236.  
  237.     ;transmission buffer empty routine, BLIT !
  238.     ;handles routines,animations
  239.     
  240. inttbe                    ;tbe interrupt
  241.     movem.l    d0-d7/a0-a6,-(sp)
  242.     lea    ($dff000).l,a6
  243.  
  244.     move.w    $01e(a6),d0
  245.     btst    #0,d0            ;no tbe ?
  246.     beq.s    intdskblk
  247.  
  248.  
  249.     btst    #6,($bfe001).l        ;muis ingedrukt ?
  250.     beq.s    inttbe.cop
  251.     btst    #2,($dff016).l
  252.     beq.s    inttbe.cop
  253.  
  254.     ifd    debug
  255.     move.w    #$700,$dff180
  256.     endc
  257.     
  258.     bsr    rotply            ;routineplayer BLIT !
  259.     bsr.s    copbuf            ;copper vullen
  260.  
  261.     ifd    debug
  262.     move.w    #$070,$dff180
  263.     endc
  264.     
  265. inttbe.cop
  266.  
  267. inttbe.end
  268.     move.w    #$0001,$09c(a6)
  269.     movem.l    (sp)+,d0-d7/a0-a6
  270.     rte
  271.  
  272. intdskblk
  273.     move.w    #$0001,$09c(a6)        ;be sure for no tbe handling
  274.     movem.l    (sp)+,d0-d7/a0-a6
  275.     move.l    inttbeold,-(sp)
  276.     rts
  277.  
  278.  
  279.     ;moves the copperbuffer to the copperlist
  280.     ;sort of double buffering
  281.     
  282. copbuf
  283.     movem.l    d0-d7/a0-a6,-(sp)
  284.  
  285.     lea    ($dff000).l,a6
  286.  
  287. copbuf.novb                ;copperchange overslaan
  288.     moveq.l    #0,d0
  289.     move.b    $005(a6),d0
  290.     lsl.w    #8,d0
  291.     moveq.l    #0,d1
  292.     move.b    $006(a6),d1
  293.     add.w    d1,d0
  294.  
  295.     cmp.w    #$4,d0            ;lower limit, all stations 100%
  296.     blt    copbuf.novb
  297.  
  298.     cmp.b    #50,ntscmode
  299.     beq.s    copbuf.pal
  300.     cmp.w    #$133-72-8,d0        ;ntsc grens
  301.     bge    copbuf.novb
  302.     bra.s    copbuf.cont
  303. copbuf.pal
  304.     cmp.w    #$133-8,d0        ;pal grens
  305.     bge    copbuf.novb
  306. copbuf.cont
  307.  
  308.     lea    gra.s,a0        ;buffer copieren
  309.     lea    cprbuf,a1
  310. copbuf_aga                ;AGA stuff :)
  311.     move.l    #(gra.ql)/4-1,d0
  312. copbuf.a
  313.     move.w    2(a0),2(a1)
  314.     add.l    #4,a0
  315.     add.l    #4,a1
  316.     dbra    d0,copbuf.a
  317.  
  318. copbuf.end
  319.     movem.l    (sp)+,d0-d7/a0-a6
  320.     rts
  321.  
  322.     ;goes back to the workbench
  323.     
  324. syson
  325.     movem.l    d0-d7/a0-a6,-(sp)
  326.  
  327.     move.w    #$0001,$dff09a        ;tbeint uit
  328.     move.l    intvbold,($6c).w
  329.     move.l    inttbeold,($64).w
  330.  
  331.     move.l    4,a6
  332.     jsr    -138(a6)        ;permit
  333.  
  334.     move.l    gfxlib,a6
  335.     jsr    -462(a6)        ;disownblitter
  336.  
  337.     move.l    wbview,a1
  338.     move.l    gfxlib,a6
  339.     jsr    _LVOLoadView(a6)     ; Fix view
  340.     jsr    _LVOWaitTOF(a6)
  341.     jsr    _LVOWaitTOF(a6)         ; wait for LoadView()
  342.  
  343. syson.ras
  344.     cmp.b    #$c0,$dff006        ;prevent copperjump
  345.     bne    syson.ras
  346.  
  347.     move.l    gfxlib,a6
  348.     move.l    gb_copinit(a6),$dff080     ; Kick it into life
  349.  
  350.     movem.l    (sp)+,d0-d7/a0-a6
  351.     rts
  352.     
  353.     ;goes back to the gadgetscreen
  354.     
  355. sysoff
  356.     movem.l    d0-d7/a0-a6,-(sp)
  357.      
  358.     move.l    gfxlib,a6
  359.     move.l    gb_ActiView(a6),wbview    ;current view
  360.     sub.l    a1,a1            ; clear a1
  361.     jsr     _LVOLoadView(a6)     ; Flush View to nothing
  362.     jsr    _LVOWaitTOF(a6)     ; Wait once
  363.     jsr    _LVOWaitTOF(a6)     ; Wait again.
  364.  
  365.     move.l    gfxlib,a6
  366.     jsr    -456(a6)        ;ownblitter
  367.  
  368.     move.l    4,a6
  369.     jsr    -132(a6)        ;forbid
  370.         
  371.     move.l    ($6c).w,intvbold
  372.     move.l    #intvb,($6c).w
  373.     move.l    ($64).w,inttbeold
  374.     move.l    #inttbe,($64).w
  375.     move.w    #$8001,$dff09a        ;tbeint aan
  376.     bsr    gracpr            ;reset copper
  377.     bsr    copbuf            ;copy copper
  378.     move.l    #cpr,$dff080
  379.  
  380.     movem.l    (sp)+,d0-d7/a0-a6
  381.     rts
  382.     
  383. cprsprrem
  384.     movem.l    d0-d7/a0-a6,-(sp)
  385.     lea    cprspr,a0
  386.     move.l    #sprdat,d0
  387.     move.w    #7,d1
  388. cprsprrem.a
  389.     move.w    d0,3*2(a0)
  390.     swap    d0
  391.     move.w    d0,1*2(a0)
  392.     swap    d0
  393.     add.l    #8,a0
  394.     dbra    d1,cprsprrem.a
  395.     movem.l    (sp)+,d0-d7/a0-a6
  396.     rts
  397.  
  398. varset                    ;variablen neerzetten
  399.     movem.l    d0-d7/a0-a6,-(sp)
  400.     move.l    #var,a0
  401.  
  402.     move.l    #cprbck,var_cprbck(a0)
  403.     move.l    gfxlib,var__GfxBase(a0)
  404.     move.b    ntscmode,var_ntsc(a0)
  405.  
  406.     move.l    curpic1,var_pic1(a0)    ;variabel
  407.     move.l    curpic2,var_pic2(a0)    ;variabel
  408.     move.w    anispd1,var_anispd1(a0)
  409.     move.w    anitel1,var_anitel1(a0)
  410.     move.b    anilop1,var_anilop1(a0)
  411.     move.l    #rottrg,var_rottrg(a0)
  412.     movem.l    (sp)+,d0-d7/a0-a6
  413.     rts
  414.     
  415.     ;this routine handles all videotracker-routines
  416.  
  417. rotply    
  418.     movem.l    d0-d7/a0-a6,-(sp)
  419.  
  420.     moveq.l    #0,d0
  421.  
  422.     lea    currot1,a2        ;routine 1
  423.     move.w    rotinf1,d0        ;routine info
  424.     bsr.s    rotplyr
  425.  
  426. rotply.end
  427.     movem.l    (sp)+,d0-d7/a0-a6
  428.     rts
  429.  
  430.     ;this routine handles 1 routine, BLIT !
  431.     
  432. rotplyr
  433.     movem.l    d0-d7/a1-a6,-(sp)
  434.  
  435.     move.l    #rot,(a2)        ;routinestart address
  436.  
  437. ;    move.b    #50,ntscmode        ;ntsc/pal hz
  438.     clr.l    curpic2            ;background picture
  439.     move.w    #1,anispd1        ;animationspeed
  440.     clr.w    anitel1            ;animation position
  441.  
  442.     lea    var,a0            ;communication-table
  443. ;    move.l    #rotincpic,curpic1    ;incbinfile !!!
  444.     clr.l    curpic2            ;background picture
  445.     move.w    #1,anispd1        ;animationspeed
  446.     clr.w    anitel1            ;animation position
  447.     move.b    #0,anilop1        ;animloop off/on !!!
  448.     move.l    #routinemode,d0        ;routinemode !!!
  449.  
  450.     sub.l    a0,a0            ;picture info legen
  451.  
  452.     tst.l    (a2)            ;is er een routine ?
  453.     beq    rotplyr.end        ;interlace handling
  454.  
  455.     move.l    intdel,d2        ;delay
  456.     move.l    inttel,d1        ;teller
  457.     cmp.w    d2,d1
  458.     blt    rotplyr.end
  459.     clr.l    inttel
  460.                 
  461.     bsr    varset            ;variabelen updaten
  462.  
  463.     move.l    (a2),a1            ;routine halen
  464.     move.l    #var,a0            ;variablen tabel
  465.  
  466.     movem.l    d3-d7/a1-a6,-(sp)
  467.     moveq.l    #0,d1            ;vars wissen
  468.     moveq.l    #0,d2
  469.     moveq.l    #0,d3
  470.     moveq.l    #0,d4
  471.     moveq.l    #0,d5
  472.     moveq.l    #0,d6
  473.     moveq.l    #0,d7
  474.     sub.l    a2,a2
  475.     sub.l    a3,a3
  476.     sub.l    a4,a4
  477.     sub.l    a5,a5
  478.  
  479.     jsr    4(a1)            ;routine afwerken
  480.     movem.l    (sp)+,d3-d7/a1-a6
  481.  
  482.     ;Routine:
  483.     ;
  484.     ;Input:
  485.     ;a0=variabelentabel
  486.     ;d0=routinemode
  487.     ;
  488.     ;Output:
  489.     ;a0=picture
  490.     ;d1=copperlist
  491.     ;d2=interruptdelay        (NOT used till now)
  492.     
  493.     move.w    #$0020,$dff09a        ;vb off !
  494.  
  495.     move.l    d2,intdel        ;delay
  496.  
  497.     lea    cprjmp,a3
  498.     move.l    #cprbck-8,d0
  499.  
  500.     cmp.l    (a2),a1            ;routine ondertussen gewipt ?
  501.     bne.s    rotplyr.nocop
  502.     tst.l    d1            ;copperlist ?
  503.     beq.s    rotplyr.nocop
  504.     move.l    d1,d0
  505. rotplyr.nocop
  506.     move.w    d0,6(a3)
  507.     swap    d0
  508.     move.w    d0,2(a3)
  509.  
  510.     cmp.l    #0,a0            ;picture ?
  511.     beq.s    rotplyr.endvb
  512.  
  513.     move.l    a0,curpic1        ;current picture (cycle)
  514.     move.l    a0,curpal1        ;current palette
  515.  
  516.     tst.b    rotdpl            ;plane is geleverd
  517.     beq.s    rotplyr.set
  518.     clr.b    rotdpl
  519.     clr.l    cycdel1            ;cycle info wissen
  520.     clr.l    4+cycdel1
  521.     clr.l    curfrm1            ;curfrm1, altijd planes zetten
  522. rotplyr.set
  523.     clr.b    dplctr
  524.     bsr.s    grap
  525.     bsr    grac            ;colorset
  526. rotplyr.endvb
  527.     move.w    #$8020,$dff09a
  528. rotplyr.end
  529.     movem.l    (sp)+,d0-d7/a1-a6
  530.     rts
  531.  
  532.     ;removes possible routine-coppers
  533.     
  534. gracpr
  535.     movem.l    d0-d7/a0-a6,-(sp)
  536.     lea    cprjmp,a3
  537.     move.l    #cprbck-8,d0        ;copperlist resetten
  538.     move.w    d0,6(a3)
  539.     swap    d0
  540.     move.w    d0,2(a3)
  541.     movem.l    (sp)+,d0-d7/a0-a6
  542.     rts
  543.  
  544. grap                    ;d7=anim
  545.     movem.l    d0-d7/a0-a6,-(sp)
  546.  
  547.     clr.l    d7
  548.  
  549.     tst.l    curpic1            ;current picture ?
  550.     beq    grap.end
  551.  
  552.     move.l    curpic1,a2        ;normal pic halen
  553.  
  554.     lea    gracprscr,a1        ;window neerzetten
  555.     move.l    hogscr,d1
  556.  
  557.     move.w    pic_hgt(a2),d3        ;pic hoogte
  558.     move.w    pic_vew(a2),d5
  559.     btst    #2,d5            ;interlace ?
  560.     beq.s    grap.nohi4
  561.     lsr.w    #1,d3            ;/2
  562. grap.nohi4
  563.     cmp.w    d3,d1
  564.     bge.s    grap.hog
  565.     move.w    d1,d3
  566. grap.hog
  567.     sub.w    d3,d1
  568.     lsr.w    #1,d1
  569.     add.w    #win_str,d1
  570.     move.w    d1,d2
  571.     add.w    d3,d2
  572.  
  573.     move.b    d1,2(a1)        ;y start
  574.     move.b    d2,6(a1)        ;y end
  575.  
  576.     move.w    pic_wid(a2),d4        ;pic breedte in bytes
  577.     lsl.l    #3,d4
  578.  
  579.     move.l    #vew_wid*8,d0
  580.     move.l    #0,d1
  581.     move.l    #$61,d6
  582.  
  583.     cmp.w    #40,pic_wid(a2)        ;overscan ?
  584.     ble.s    grap.noov1
  585.     move.l    #$41,d6
  586. grap.noov1
  587.  
  588.     move.w    pic_vew(a2),d5
  589.     btst    #15,d5            ;hires ?
  590.     beq.s    grap.nohi2
  591.  
  592.     move.l    #(vew_wid)*8*2,d0
  593.     move.l    #1,d1
  594.     move.l    #$61,d6
  595.  
  596.     cmp.w    #80,pic_wid(a2)        ;overscan ?
  597.     ble.s    grap.nohi2
  598.     move.l    #(vew_wid)*8*2,d0
  599.     move.l    #$51,d6
  600.  
  601.     bra.s    grap.noshi2
  602. grap.nohi2    
  603.     btst    #6,d5            ;super hires ?
  604.     beq.s    grap.noshi2
  605.  
  606.     move.l    #(vew_wid)*8*4,d0
  607.     move.l    #2,d1
  608.     move.l    #$61,d6
  609.  
  610.     cmp.w    #80*2,pic_wid(a2)    ;overscan ?
  611.     ble.s    grap.noshi2
  612.     move.l    #(vew_wid)*8*4,d0
  613.     move.l    #$51,d6
  614.  
  615. grap.noshi2    
  616.  
  617.     clr.w    d5
  618.     cmp.w    d0,d4            ;breeder dan scherm ?
  619.     ble.s    grap.c
  620.     move.w    d4,d5
  621.     move.w    d0,d4
  622.     sub.w    d0,d5            ;modulo
  623.     lsr.w    #3,d5            ;/8
  624. grap.c
  625.     lsr.w    d1,d0
  626.     lsr.w    d1,d4
  627.  
  628.     move.w    d0,d2
  629.     sub.w    d4,d2
  630.     lsr.w    #1,d2            ;/2
  631.  
  632.     add.w    d6,d2
  633.     move.b    d2,3(a1)        ;x start
  634.     move.w    d2,d3            ;d3 bewaren !
  635.  
  636.     add.w    d4,d2            ;d4 bewaren !
  637.     move.b    d2,7(a1)        ;x end
  638.     
  639.     move.w    pic_vew(a2),d6
  640.     btst    #15,d6            ;hires ?
  641.     beq.s    grap.nohi5    
  642.     add.l    d4,d4            ;*2
  643.     bra.s    grap.noshi5
  644. grap.nohi5
  645.     btst    #6,d6            ;super hires ?
  646.     beq.s    grap.noshi5    
  647.     add.l    d4,d4            ;*4
  648.     add.l    d4,d4
  649. grap.noshi5
  650.  
  651.     move.l    d7,-(sp)
  652.     move.w    pic_vew(a2),d6
  653.     move.l    #17,d0
  654.     move.l    #4,d1            ;ecs 1
  655.     move.l    #3,d7
  656.  
  657.     btst    #15,d6            ;hires ?
  658.     beq.s    grap.nohi3    
  659.     move.l    #17,d0            ;ecs 9
  660.     move.l    #4,d1            ;ecs 2
  661.     move.l    #2,d7
  662.     bra.s    grap.noshi3
  663. grap.nohi3
  664.     btst    #6,d6            ;super hires ?
  665.     beq.s    grap.noshi3    
  666.     move.l    #17,d0            ;ecs 9
  667.     move.l    #4,d1            ;ecs 2
  668.     move.l    #1,d7
  669. grap.noshi3
  670.     sub.w    d0,d3
  671.     lsr.w    #1,d3
  672.     move.w    d3,10(a1)        ;ddfstrt
  673.     
  674.     move.w    d4,d2            ;pic breedte in pixels
  675.     lsr.w    #4,d2            ;/16
  676.     sub.w    d1,d2            ;-1
  677.  
  678.     lsl.w    d7,d2            ;*8
  679.     add.w    d2,d3
  680.     move.w    d3,14(a1)        ;ddfstop
  681.     move.l    (sp)+,d7
  682.     
  683.     lea    pic_raw(a2),a0
  684.  
  685.     moveq.l    #0,d2
  686.     move.w    pic_dpt(a2),d2
  687.     sub.l    #1,d2
  688.     muls    pic_wid(a2),d2
  689.     add.w    d2,d5
  690.  
  691.     move.w    pic_vew(a2),d2        ;viewmode add
  692.     btst    #2,d2
  693.     beq.s    grap.nolace4
  694.  
  695.     moveq.l    #0,d2
  696.     move.w    pic_dpt(a2),d2
  697.     muls    pic_wid(a2),d2
  698.     add.w    d2,d5            ;interlace gedoe
  699. grap.nolace4
  700.  
  701.     lea    gracprbpl,a4        ;iffpln neerzetten
  702.     lea    gracprpln,a0        ;iffpln neerzetten
  703.     moveq.l    #0,d2
  704.     move.w    pic_dpt(a2),d2        ;plnnummer 1 halen
  705.     move.l    #8,d6            ;copper step !
  706.  
  707.     tst.l    curpic2            ;2de picture ?
  708.     bne.s    grap.pic2
  709. grap.nopic2
  710.     move.w    d5,34(a1)        ;modulo oneven zetten
  711.     bra    grap.nodpl
  712. grap.pic2
  713.     move.l    curpic2,a3        ;oneven plane
  714.     move.l    curpic2+4,a6        ;oneven plane
  715.     move.l    currot2,a5        ;oneven plane
  716.     clr.l    curpic2            ;mischien niet goed
  717.     clr.l    curpic2+4        ;mischien niet goed
  718.     clr.l    curpal2            ;mischien niet goed
  719.     clr.l    currot2            ;mischien niet goed
  720.  
  721.     cmp.l    curpic1,a3        ;picture hetzelfde ?
  722.     beq.s    grap.nopic2
  723.     
  724.     cmp.l    #0,currot1        ;routine ?    
  725.     beq.s    grap.norot
  726.     cmp.l    currot1,a5        ;routine hetzelfde ?
  727.     beq.s    grap.nopic2
  728. grap.norot
  729.     cmp.b    #4,d2            ;> 16 kleuren ? (AGA)
  730.     bgt    grap.nopic2
  731.  
  732.     move.w    pic_dpt(a3),d3        ;plnnummer 2 halen
  733.     cmp.b    d2,d3            ;gelijke plnummers ?
  734.     bne.s    grap.nopic2
  735.     move.w    pic_vew(a2),d1
  736.     cmp.w    pic_vew(a3),d1        ;view gelijk ?
  737.     bne.s    grap.nopic2
  738.  
  739.     move.w    pic_vew(a2),d1        ;groter dan view test
  740.     btst    #6,d1            ;super hires ?
  741.     beq.s    grap.nohi2a
  742.     move.l    #vew_wid*4,d1
  743.     bra.s    grap.nohi2b
  744. grap.nohi2a
  745.     btst    #15,d1            ;hires ?
  746.     beq.s    grap.noshi2a
  747.     move.l    #vew_wid*2,d1
  748.     bra.s    grap.nohi2b
  749. grap.noshi2a
  750.     move.l    #vew_wid,d1
  751. grap.nohi2b
  752.     cmp.w    pic_wid(a2),d1        ;breder dan view ?
  753.     bgt.s    grap.small
  754.     cmp.w    pic_wid(a3),d1        ;breder dan view ?
  755.     bgt.s    grap.small
  756.  
  757.     move.w    pic_vew(a2),d1
  758.     btst    #2,d1
  759.     beq.s    grap.nolace8a
  760.     move.l    hogscr,d1
  761.     add.l    d1,d1
  762.     bra.s    grap.nolace8b
  763. grap.nolace8a
  764.     move.l    hogscr,d1
  765. grap.nolace8b
  766.     cmp.w    pic_hgt(a2),d1        ;hoger dan view ?
  767.     bgt.s    grap.small
  768.     cmp.w    pic_hgt(a3),d1        ;hoger dan view ?
  769.     bgt.s    grap.small
  770.     bra.s    grap.big
  771.  
  772. grap.small
  773.     move.w    pic_hgt(a2),d1        ;wid+hgt<vew
  774.     cmp.w    pic_hgt(a3),d1        ;hoogte gelijk ?
  775.     bne    grap.nopic2
  776.     move.w    pic_wid(a2),d1
  777.     cmp.w    pic_wid(a3),d1        ;breedte gelijk ?
  778.     bne    grap.nopic2
  779.  
  780. grap.big
  781.     move.l    a3,curpic2        ;toch wel goed !
  782.     move.l    a6,curpic2+4
  783.     move.l    a3,curpal2
  784.     move.l    a5,currot2
  785.  
  786.     tst.b    dplctr            ;dual playfield al gezet ?
  787.     beq    grap.nocop
  788.  
  789.     move.w    30(a1),34(a1)        ;modulo copieren
  790.  
  791.     move.w    2(a4),d1        ;bplcon0
  792.     btst    #10,d1            ;al dual playfield ?
  793.     beq.s    grap.ta
  794.  
  795.     move.w    2(a0),10(a0)        ;plane 0>1 copieren
  796.     move.w    6(a0),14(a0)
  797.  
  798.     move.w    18(a0),26(a0)        ;plane 2>3 copieren
  799.     move.w    22(a0),30(a0)
  800.  
  801.     move.w    34(a0),42(a0)        ;plane 4>5 copieren
  802.     move.w    38(a0),46(a0)
  803.  
  804.     move.w    50(a0),58(a0)        ;plane 6>7 copieren
  805.     move.w    54(a0),62(a0)
  806.  
  807.     bra.s    grap.tb
  808. grap.ta
  809.     move.w    24(a0),58(a0)        ;plane 3>7 copieren
  810.     move.w    28(a0),62(a0)
  811.  
  812.     move.w    18(a0),42(a0)        ;plane 2>5 copieren
  813.     move.w    22(a0),46(a0)
  814.  
  815.     move.w    10(a0),26(a0)        ;plane 1>3 copieren
  816.     move.w    14(a0),30(a0)
  817.  
  818.     move.w    2(a0),10(a0)        ;plane 0>1 copieren
  819.     move.w    6(a0),14(a0)
  820.  
  821. grap.tb
  822.     move.l    #palette,a3        ;palette copieren
  823.  
  824.     move.w    #16-1,d1
  825. grap.pal
  826.     move.l    (a3)+,60(a3)
  827.     dbra    d1,grap.pal
  828.  
  829. grap.nocop
  830.     add.w    d3,d2            ;aantal bitplanes
  831.     cmp.w    #8,d2            ;8 bitplanes ?
  832.     blt    grap.no8planes2
  833.     move.w    #%10000,d2        ;only bit 4
  834.     bra    grap.8planes2
  835. grap.no8planes2
  836.     lsl.w    #8,d2
  837.     lsl.w    #4,d2
  838. grap.8planes2
  839.     or.w    #$400,d2        ;dual playfield aan
  840.     move.w    d2,2(a4)        ;bplcon0
  841.  
  842.     movem.l    d0-d7/a0-a6,-(sp)
  843.  
  844.     move.l    curpic,a2        ;animpic ?
  845.     move.l    curfrm,d7
  846.     cmp.l    #0,a2
  847.     bne.s    grap.noanipic
  848.  
  849.     move.l    curpic2,a2        ;normal pic ?
  850.     move.l    curfrm2,d7
  851.     cmp.l    #0,a2
  852.     beq.s    grap.nodplpic
  853.  
  854. grap.noanipic
  855.     add.l    d6,a0
  856.     add.w    d6,d6
  857.     bsr.s    grappln            ;a2,d6,d7,d0
  858. grap.nodplpic
  859.     movem.l    (sp)+,d0-d7/a0-a6
  860.     add.w    d6,d6
  861.     bra.s    grap.nodpla
  862.  
  863.  
  864. grap.nodpl                ;geen dual playfield
  865.     cmp.w    #8,d2            ;8 bitplanes ?
  866.     blt    grap.no8planes
  867.     move.w    #%10000,d2        ;only bit 4
  868.     bra    grap.8planes
  869. grap.no8planes
  870.     lsl.w    #8,d2
  871.     lsl.w    #4,d2
  872. grap.8planes
  873.     move.w    d2,2(a4)        ;bplcon0
  874.  
  875. grap.nodpla
  876.     move.w    d5,30(a1)        ;modulo even
  877.  
  878.     moveq.l    #0,d3
  879.     add.w    pic_vew(a2),d3        ;viewmode add
  880.     moveq.l    #0,d2
  881.     move.w    2(a4),d2
  882.     or.l    d3,d2
  883.  
  884.     ifd    gui
  885.     tst.b    genlck
  886.     bne    grap.genset
  887.     endc
  888.  
  889.     or.l    #$100,d2        ;genlock off ($302)
  890.  
  891.     ifd    gui
  892.     bra    grap.gencont
  893. grap.genset
  894.     or.l    #$102,d2        ;genlock on ($302)
  895. grap.gencont
  896.     endc
  897.     
  898.     move.w    d2,2(a4)
  899.     
  900.     bsr.s    grappln            ;a2,d6,d7,d0
  901.  
  902. grap.end
  903.     
  904.     movem.l    (sp)+,d0-d7/a0-a6
  905.     rts
  906.         
  907.  
  908.     ;sets on of the 2 possible pictures to the copper
  909.     ;handles interlace
  910.  
  911.     ;d7=framenummer
  912.     ;d6=copperliststap
  913.     ;d0=raw planes positie
  914.     ;a2=current picture
  915. grappln                    ;planes invullen 
  916.     movem.l    d0-d7/a0-a6,-(sp)
  917.  
  918.     lea    pic_raw(a2),a1
  919.     move.l    a1,d0            ;raw planes
  920.     
  921.     moveq.l    #0,d2            ;x*y
  922.     move.w    pic_wid(a2),d2
  923.     lsr.l    #1,d2            ;/2
  924.     moveq.l    #0,d3
  925.     move.w    pic_hgt(a2),d3
  926.     muls    d3,d2
  927.     
  928.     move.l    d2,d4
  929.     add.l    d2,d2
  930.  
  931.     move.w    pic_dpt(a2),d3
  932.     muls    d3,d4            ;hele picture size
  933.     muls    d7,d4            ;frame*size d7 !!!
  934.  
  935.     add.l    d4,d4
  936.  
  937.     add.l    d4,d0
  938.  
  939.     move.l    #vew_wid,d5        ;max x view
  940.     move.l    hogscr,d4        ;max y view
  941.     move.w    pic_vew(a2),d1        ;viewmode add
  942.     btst    #2,d1
  943.     beq.s    grappln.nolace
  944.     add.l    d4,d4            ;max y view
  945. grappln.nolace
  946.     btst    #15,d1            ;hires ?
  947.     beq.s    grappln.nohi
  948.     move.l    #vew_wid*2,d5        ;max x view
  949.     bra.s    grappln.noshi
  950. grappln.nohi
  951.     btst    #6,d1            ;super hires ?
  952.     beq.s    grappln.noshi
  953.     move.l    #vew_wid*4,d5        ;max x view
  954. grappln.noshi
  955.  
  956.     moveq.l    #0,d3            ;scherm centreren
  957.     move.w    pic_wid(a2),d3        ;pic breedte in bytes
  958.     cmp.w    d5,d3            ;breder dan scherm ?
  959.     ble.s    grappln.qa
  960.     sub.w    d5,d3            ;-scherm breedte
  961.     lsr.w    #2,d3            ;/4
  962.  
  963.     add.l    d3,d3
  964.  
  965.     add.l    d3,d0
  966. grappln.qa
  967.     move.w    pic_hgt(a2),d3        ;pic hoogte in bytes
  968.     cmp.w    d4,d3            ;hoger dan scherm ?
  969.     ble.s    grappln.qb
  970.     sub.w    d4,d3            ;-scherm breedte
  971.     lsr.w    #1,d3            ;/2
  972.     moveq.l    #0,d5
  973.     move.w    pic_wid(a2),d5        ;pic breedte in bytes
  974.     muls    pic_dpt(a2),d5
  975.     muls    d5,d3
  976.     add.l    d3,d0
  977. grappln.qb
  978.     moveq.l    #0,d2
  979.     move.w    pic_wid(a2),d2
  980.  
  981.     move.w    pic_vew(a2),d5        ;interlace flipping ?
  982.     btst    #2,d5
  983.     beq.s    grappln.nolac7b
  984.  
  985.     move.w    $04(a6),d5        ;even/oneven ?
  986.     btst    #15,d5
  987.     beq.s    grappln.nolac7b
  988.     
  989.     moveq.l    #0,d3
  990.     move.w    pic_wid(a2),d3
  991.     muls    pic_dpt(a2),d3
  992.     add.l    d3,d0
  993. grappln.nolac7b
  994.  
  995.     move.w    pic_dpt(a2),d1        ;plnnummer 1 halen
  996.     tst.w    d1            ;0 planes ?
  997.     beq    grappln.end
  998.     sub.w    #1,d1
  999. grappln.a
  1000.     move.w    d0,3*2(a0)
  1001.     swap    d0
  1002.     move.w    d0,1*2(a0)
  1003.     swap    d0
  1004.     add.l    d6,a0            ;d6=copper step !
  1005.     add.l    d2,d0
  1006.     dbra    d1,grappln.a
  1007.  
  1008.     cmp.w    #8,pic_dpt(a2)        ;8 planes ?
  1009.     bne    grappln.noham8
  1010.     btst    #3,pic_vew(a2)        ;ham ?
  1011.     beq    grappln.noham8
  1012.  
  1013.     move.w    -14(a0),d0        ;get 6
  1014.     move.w    -10(a0),d1
  1015.     move.w    -6(a0),d2        ;get 7
  1016.     move.w    -2(a0),d3
  1017.     move.w    -18(a0),-2(a0)        ;5>7
  1018.     move.w    -22(a0),-6(a0)        ;5>7
  1019.     move.w    -26(a0),-10(a0)        ;4>6
  1020.     move.w    -30(a0),-14(a0)        ;4>6
  1021.     move.w    -34(a0),-18(a0)        ;3>5
  1022.     move.w    -38(a0),-22(a0)        ;3>5
  1023.     move.w    -42(a0),-26(a0)        ;2>4
  1024.     move.w    -46(a0),-30(a0)        ;2>4
  1025.     move.w    -50(a0),-34(a0)        ;1>3
  1026.     move.w    -54(a0),-38(a0)        ;1>3
  1027.     move.w    -58(a0),-42(a0)        ;0>2
  1028.     move.w    -62(a0),-46(a0)        ;0>2
  1029.     move.w    d0,-62(a0)        ;6>0
  1030.     move.w    d1,-58(a0)        ;6>0
  1031.     move.w    d2,-54(a0)        ;7>1
  1032.     move.w    d3,-50(a0)        ;7>1
  1033. grappln.noham8
  1034.  
  1035. grappln.end
  1036.     movem.l    (sp)+,d0-d7/a0-a6
  1037.     rts
  1038.  
  1039.     ;sets palettes to palette-buffer
  1040.     
  1041. grac
  1042.     movem.l    d0-d7/a0-a6,-(sp)
  1043.  
  1044.     lea    curpal1,a3        ;palette 1
  1045.     move.l    #palette,a1
  1046.     bsr.s    gracfrm
  1047.  
  1048.     lea    curpal2,a3        ;palette 2 (dpl)
  1049.     move.l    #16*4+palette,a1
  1050.     bsr.s    gracfrm
  1051.     
  1052.     bsr    palctr            ;palette-buffer to copper
  1053. grac.end
  1054.     movem.l    (sp)+,d0-d7/a0-a6
  1055.     rts
  1056.         
  1057.     ;moves palette from picture to palette-buffer
  1058.  
  1059. gracfrm
  1060.     movem.l    d0-d7/a0-a6,-(sp)
  1061.     tst.l    (a3)            ;palette aanwezig ?
  1062.     beq.s    gracfrm.end
  1063.  
  1064.     move.l    (a3),a2            ;current palette
  1065.     
  1066.     cmp.l    #'PALE',(a2)        ;palette ?
  1067.     bne.s    gracfrm.pict
  1068.     lea    6(a2),a0        ;palette
  1069.     move.w    4(a2),d0        ;aantal kleuren
  1070.     bra.s    gracfrm.col
  1071. gracfrm.pict
  1072.     cmp.l    #'ANIM',(a2)        ;animatie ?
  1073.     bne.s    gracfrm.noanim
  1074.  
  1075.     moveq.l    #0,d1
  1076.     move.w    pic_ani(a2),d1
  1077.     bclr    #7,d1            ;behandelbit weghalen
  1078.  
  1079.     moveq.l    #0,d3
  1080.     move.w    pic_wid(a2),d3
  1081.     lsr.w    #1,d3            ;/2
  1082.     muls    pic_hgt(a2),d3
  1083.     muls    pic_dpt(a2),d3
  1084.  
  1085.     add.l    d3,d3
  1086.  
  1087.     add.l    #pic_raw,d3
  1088.     move.l    d3,d5
  1089.  
  1090.     btst    #0,d1
  1091.     bne.s    gracfrm.buf2
  1092.     moveq.l    #0,d5
  1093. gracfrm.buf2
  1094.     add.l    d5,a2
  1095. gracfrm.noanim
  1096.     lea    pic_pal(a2),a0        ;palette
  1097.     move.w    pic_palnum(a2),d0
  1098.  
  1099.     tst.w    d0            ;0 planes ?
  1100.     beq.s    gracfrm.end
  1101. gracfrm.col
  1102. gracfrm.fa
  1103.     move.l    (a0)+,(a1)+
  1104.     dbra    d0,gracfrm.fa
  1105. gracfrm.end
  1106.     movem.l    (sp)+,d0-d7/a0-a6
  1107.     rts
  1108.     
  1109.     ;handles colorcycling in the palette-buffer
  1110.  
  1111. palcycctr
  1112.     movem.l    d0-d7/a0-a6,-(sp)
  1113.  
  1114.     move.l    curpic1,a2        ;current raw
  1115.     cmp.l    #0,a2
  1116.     beq.s    palcycctr.qb
  1117.     lea    cycdel1,a3        ;cycle delays
  1118.     move.l    #paltab,a4
  1119.     bsr    palcyc
  1120. palcycctr.qb
  1121.     move.l    curpic2,a2        ;current raw
  1122.     cmp.l    #0,a2
  1123.     beq.s    palcycctr.c
  1124.     lea    cycdel2,a3        ;cycle delays
  1125.     move.l    #16*2+paltab,a4
  1126.     bsr    palcyc
  1127. palcycctr.c
  1128.     movem.l    (sp)+,d0-d7/a0-a6
  1129.     rts
  1130.     
  1131.     ;copies palette-buffer to copper
  1132.  
  1133. palctr
  1134.     movem.l    d0-d7/a0-a6,-(sp)
  1135.  
  1136.     lea    gracprcol,a1        ;AGA
  1137.     move.l    #palette,a0
  1138.     move.l    #paltab,a2
  1139.     move.w    #8-1,d6
  1140. palctr.e
  1141.     move.w    #32-1,d7
  1142. palctr.d
  1143.     move.w    (a2)+,d0            ;get cycle-position
  1144.     move.w    (a0,d0),6(a1)            ;high RGB bits
  1145.     move.w    2(a0,d0),((32+1)*4)+6(a1)    ;low RGB bits
  1146.     add.l    #4,a1
  1147.     dbra    d7,palctr.d
  1148.     add.l    #((32+2)*4),a1
  1149.     dbra    d6,palctr.e
  1150. palctr.end
  1151.     movem.l    (sp)+,d0-d7/a0-a6
  1152.     rts
  1153.  
  1154.     ;reset palette tabel, for proper color cycling
  1155.  
  1156. paltabres
  1157.     movem.l    d0-d7/a0-a6,-(sp)
  1158.     lea    paltab,a0
  1159.     clr.l    d0
  1160.     move.w    #256-1,d1
  1161. paltabres.a
  1162.     move.w    d0,(a0)+
  1163.     add.w    #4,d0            ;aga color words, high RGB + low RGB
  1164.     dbra    d1,paltabres.a
  1165. paltabres.end
  1166.     movem.l    (sp)+,d0-d7/a0-a6
  1167.     rts
  1168.  
  1169.     ;colorcyclinghandling of a palette
  1170.  
  1171. palcyc
  1172.     movem.l    d0-d7/a0-a6,-(sp)
  1173.     move.w    #4-1,d7            ;4 cycles
  1174. palcyc.d
  1175.     tst.w    (a3)+            ;delay klaar ?
  1176.     bne.s    palcyc.c
  1177.     
  1178.     moveq.l    #0,d1
  1179.     move.b    pic_cycstr(a2),d1    ;start color
  1180.     lsl.b    #1,d1        ;*2
  1181.  
  1182.     moveq.l    #0,d2
  1183.     move.b    pic_cycend(a2),d2    ;end color
  1184.     lsl.b    #1,d2        ;*2
  1185.  
  1186.     moveq.l    #0,d3
  1187.     move.b    pic_cycadd(a2),d3    ;richting
  1188.  
  1189.     move.l    a4,a0            ;palette pointer
  1190.     move.l    a0,a1
  1191.     add.l    d1,a0            ;startcolor
  1192.     add.l    d2,a1            ;endcolor
  1193.     
  1194.     cmp.b    #1,d3            ;omhoog
  1195.     beq.s    palcyc.up    
  1196.     cmp.b    #3,d3            ;omlaag
  1197.     beq.s    palcyc.down
  1198.     bra.s    palcyc.i
  1199.  
  1200. palcyc.up                ;kleuren copieren
  1201.     move.w    (a1),d4            ;laatst color bewaren
  1202. palcyc.f                ;kleuren copieren
  1203.     cmp.l    a0,a1
  1204.     beq.s    palcyc.fa
  1205.     move.w    -(a1),2(a1)
  1206.     bra.s    palcyc.f
  1207. palcyc.fa
  1208.     move.w    d4,(a1)
  1209.     bra.s    palcyc.g    
  1210.     
  1211. palcyc.down
  1212.     move.w    (a0),d4            ;laatst color bewaren
  1213. palcyc.h                ;kleuren copieren
  1214.     cmp.l    a0,a1
  1215.     beq.s    palcyc.ha
  1216.     move.w    2(a0),(a0)+
  1217.     bra.s    palcyc.h
  1218. palcyc.ha
  1219.     move.w    d4,(a1)
  1220.  
  1221. palcyc.g
  1222.     move.b    pic_cycspd(a2),-1(a3)    ;delay zetten
  1223.     bra.s    palcyc.i
  1224. palcyc.c
  1225.     sub.w    #1,-2(a3)        ;cycle delay aftellen
  1226. palcyc.i
  1227.     add.l    #4,a2            ;next cycle info
  1228.     dbra    d7,palcyc.d
  1229.  
  1230. palcyc.qb
  1231.     movem.l    (sp)+,d0-d7/a0-a6
  1232.     rts
  1233.  
  1234.  
  1235.  
  1236. ;    SECTION    variabelen,DATA_c
  1237.  
  1238.     cnop    0,2
  1239. curtsk        dc.l    0
  1240. tskpri        dc.l    0
  1241. duplok        dc.l    0
  1242. inttel        dc.l    0
  1243. intdel        dc.l    0
  1244.  
  1245. form        dc.l    0
  1246. ifffil        dc.l    0
  1247. intvbold    dc.l    0
  1248. inttbeold    dc.l    0
  1249. patpos        dc.l    0
  1250. gfxlib        dc.l    0
  1251. doslib        dc.l    0
  1252. wbview      dc.l    0
  1253. mt_data        dc.l    0
  1254. memvid        dc.l    0
  1255. oldcprlist    dc.l    0
  1256. hogscr        dc.l    vew_hgt
  1257.  
  1258. inspos        dc.l    -1
  1259. anispd1        dc.w    1    ;nooit op 0 !
  1260. anispd2        dc.w    1
  1261.  
  1262.         cnop    0,2
  1263. varclr.s            ;start wissen
  1264. oldrot        dc.l    0
  1265. curpic        dc.l    0
  1266. curfrm        dc.l    0
  1267. cycdel1        ds.w    4
  1268. cycdel2        ds.w    4
  1269.  
  1270. rotinf1        dc.w    0
  1271. rotinf2        dc.w    0
  1272.  
  1273. effspd        dc.w    0
  1274. efflop        dc.b    0
  1275. anilop1        dc.b    0
  1276. anilop2        dc.b    0
  1277. anipal1        dc.b    0
  1278. anipal2        dc.b    0
  1279. rotdpl        dc.b    1
  1280. rottrg        dc.b    0
  1281. dplctr        dc.b    0
  1282.         cnop    0,2
  1283.  
  1284. insdat        ds.l    4
  1285. inspri        dc.l    0
  1286. instel        dc.w    0
  1287.  
  1288. cureff        dc.l    0
  1289. efftel        dc.w    0
  1290.  
  1291. curpal1        dc.l    0
  1292. curpal2        dc.l    0
  1293. currot1        dc.l    0
  1294. currot2        dc.l    0
  1295. curpic1        dc.l    0
  1296. curpic2        dc.l    0
  1297. anitel1        dc.w    0
  1298. anitel2        dc.w    0
  1299. curfrm1        dc.l    0
  1300. curfrm2        dc.l    0
  1301. oldfrm1        dc.l    0
  1302. oldfrm2        dc.l    0
  1303.  
  1304. varclr.e
  1305.         dc.l    0            ;wisruimte
  1306.     
  1307. varclr.ql    equ    varclr.e-varclr.s    ;wislengte
  1308.     
  1309. ntscmode    dc.b    0
  1310. end        dc.b    0
  1311.  
  1312. pronam    dc.b    'VideoTracker',0
  1313.     cnop    0,2
  1314. dosnam    dc.b    'dos.library',0
  1315.     cnop    0,4
  1316. gfxnam    dc.b    'graphics.library',0
  1317.     cnop    0,4
  1318.     
  1319.     cnop    0,4
  1320. gra.s            ;copperlist edit buffer
  1321. gracprscr
  1322.     dc.w    $8e,$3381,$90,$81c1,$92,$003c,$94,$00d0
  1323. gracprbpl
  1324.     dc.w    $100,$0000,$102,$0000,$104,$0020
  1325.     dc.w    $108,$0000,$10a,$0000,$1fc,$0003
  1326. gracprpln
  1327.     dc.w    $e0,$0000,$e2,$0000    ;1
  1328.     dc.w    $e4,$0000,$e6,$0000    ;2
  1329.     dc.w    $e8,$0000,$ea,$0000    ;3
  1330.     dc.w    $ec,$0000,$ee,$0000    ;4
  1331.     dc.w    $f0,$0000,$f2,$0000    ;5
  1332.     dc.w    $f4,$0000,$f6,$0000    ;6
  1333.     dc.w    $f8,$0000,$fa,$0000    ;7
  1334.     dc.w    $fc,$0000,$fe,$0000    ;8
  1335. gracprcol
  1336.     dc.w    $106,$0000
  1337.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1338.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1339.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1340.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1341.     dc.w    $106,$0200
  1342.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1343.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1344.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1345.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1346.  
  1347.     dc.w    $106,$2000
  1348.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1349.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1350.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1351.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1352.     dc.w    $106,$2200
  1353.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1354.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1355.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1356.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1357.  
  1358.     dc.w    $106,$4000
  1359.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1360.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1361.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1362.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1363.     dc.w    $106,$4200
  1364.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1365.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1366.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1367.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1368.  
  1369.     dc.w    $106,$6000
  1370.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1371.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1372.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1373.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1374.     dc.w    $106,$6200
  1375.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1376.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1377.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1378.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1379.  
  1380.     dc.w    $106,$8000
  1381.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1382.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1383.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1384.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1385.     dc.w    $106,$8200
  1386.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1387.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1388.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1389.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1390.  
  1391.     dc.w    $106,$a000
  1392.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1393.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1394.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1395.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1396.     dc.w    $106,$a200
  1397.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1398.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1399.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1400.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1401.  
  1402.     dc.w    $106,$c000
  1403.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1404.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1405.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1406.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1407.     dc.w    $106,$c200
  1408.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1409.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1410.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1411.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1412.  
  1413.     dc.w    $106,$e000
  1414.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1415.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1416.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1417.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1418.     dc.w    $106,$e200
  1419.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1420.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1421.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1422.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1423.  
  1424.     dc.w    $106,$1000
  1425.  
  1426. cprjmp
  1427.     dc.w    $080,0,$082,0
  1428. gra.e
  1429. gra.ql    equ    gra.e-gra.s        ;block lengte
  1430.  
  1431. cpr                    ;real copperlist
  1432.     dc.w    $0001,$fffe
  1433.     dc.w    $09c,$8001        ;tbeint
  1434. cprspr
  1435.     dc.w    $120,$0000,$122,$0000
  1436.     dc.w    $124,$0000,$126,$0000
  1437.     dc.w    $128,$0000,$12a,$0000
  1438.     dc.w    $12c,$0000,$12e,$0000
  1439.     dc.w    $130,$0000,$132,$0000
  1440.     dc.w    $134,$0000,$136,$0000
  1441.     dc.w    $138,$0000,$13a,$0000
  1442.     dc.w    $13c,$0000,$13e,$0000
  1443.  
  1444. cprbuf
  1445.     dc.w    $8e,$3381,$90,$81c1,$92,$003c,$94,$00d0
  1446.     dc.w    $100,$9000,$102,$0000,$104,$0020
  1447.     dc.w    $108,$0000,$10a,$0000,$1fc,$0003
  1448.  
  1449.     dc.w    $e0,$0000,$e2,$0000    ;0
  1450.     dc.w    $e4,$0000,$e6,$0000    ;1
  1451.     dc.w    $e8,$0000,$ea,$0000    ;2
  1452.     dc.w    $ec,$0000,$ee,$0000    ;3
  1453.     dc.w    $f0,$0000,$f2,$0000    ;4
  1454.     dc.w    $f4,$0000,$f6,$0000    ;5
  1455.     dc.w    $f8,$0000,$fa,$0000    ;6
  1456.     dc.w    $fc,$0000,$fe,$0000    ;7
  1457.  
  1458.     dc.w    $106,$0000
  1459.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1460.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1461.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1462.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1463.     dc.w    $106,$0200
  1464.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1465.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1466.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1467.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1468.  
  1469.     dc.w    $106,$2000
  1470.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1471.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1472.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1473.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1474.     dc.w    $106,$2200
  1475.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1476.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1477.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1478.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1479.  
  1480.     dc.w    $106,$4000
  1481.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1482.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1483.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1484.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1485.     dc.w    $106,$4200
  1486.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1487.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1488.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1489.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1490.  
  1491.     dc.w    $106,$6000
  1492.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1493.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1494.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1495.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1496.     dc.w    $106,$6200
  1497.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1498.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1499.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1500.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1501.  
  1502.     dc.w    $106,$8000
  1503.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1504.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1505.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1506.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1507.     dc.w    $106,$8200
  1508.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1509.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1510.      dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1511.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1512.  
  1513.     dc.w    $106,$a000
  1514.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1515.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1516.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1517.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1518.     dc.w    $106,$a200
  1519.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1520.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1521.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1522.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1523.  
  1524.     dc.w    $106,$c000
  1525.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1526.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1527.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1528.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1529.     dc.w    $106,$c200
  1530.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1531.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1532.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1533.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1534.  
  1535.     dc.w    $106,$e000
  1536.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1537.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1538.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1539.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1540.     dc.w    $106,$e200
  1541.     dc.w    $180,0,$182,0,$184,0,$186,0,$188,0,$18a,0,$18c,0,$18e,0
  1542.     dc.w    $190,0,$192,0,$194,0,$196,0,$198,0,$19a,0,$19c,0,$19e,0
  1543.     dc.w    $1a0,0,$1a2,0,$1a4,0,$1a6,0,$1a8,0,$1aa,0,$1ac,0,$1ae,0
  1544.     dc.w    $1b0,0,$1b2,0,$1b4,0,$1b6,0,$1b8,0,$1ba,0,$1bc,0,$1be,0
  1545.  
  1546.     dc.w    $106,$1000
  1547.  
  1548.     dc.w    $080,0,$082,0
  1549. cprbuf.e
  1550.  
  1551.     dc.w    $088,$0000        ;copjmp2
  1552.     dc.w    $080,0,$082,0        ;moet achter cprbck blijven !
  1553. cprbck
  1554. sprdat
  1555.     dc.w    $ffff,$fffe
  1556.  
  1557. palette        ds.l    256        ;palette 24-bits, far out !
  1558. paltab        ds.w    256        ;palette cycle-tabel
  1559.  
  1560.     cnop    0,2
  1561. var    ds.b    $300    ;variabelen voor routines
  1562.  
  1563.     
  1564. ;    SECTION    10,CODE_C
  1565.         endc
  1566.  
  1567. ; this is the routine-source
  1568. ;**********************************************************************
  1569.  
  1570. cop_hgt    equ    vew_hgt-4
  1571.  
  1572. ;    Input:
  1573. ;    a0=variabelen tabel
  1574. ;    d0=routinfo
  1575.  
  1576. ;    Output:
  1577. ;    a0=picture
  1578. ;    d1=copperlist
  1579.  
  1580.  
  1581.     SECTION    3,CODE
  1582.  
  1583.     cnop    0,8
  1584. rot
  1585. rotp
  1586.     ifd    ocs
  1587.     dc.l    'ROTO'
  1588.     endc
  1589.     ifnd    ocs
  1590.     dc.l    'ROTA'
  1591.     endc
  1592.     
  1593.     movem.l    d2-d7/a2-a6,-(sp)
  1594.  
  1595.     lea    ($dff000).l,a6        ;hardware
  1596.     lea    rot,a5            ;prog base
  1597.     ifd    rout
  1598.     move.l    #rotc,a2
  1599.     endc
  1600.     move.l    a2,rotchp-rot(a5)
  1601.  
  1602.     bsr    rotfil
  1603.  
  1604.     movem.l    d0-d7/a0-a6,-(sp)
  1605.  
  1606.     move.l    var_cprbck(a0),d1
  1607.     sub.l    #8,d1
  1608.  
  1609.     move.l    rotchp-rot(a5),a1
  1610.     add.l    #rotcop.1-rotc,a1        ;copperjump adres zetten
  1611.     add.l    rotbuf-rot(a5),a1
  1612.     move.w    d1,6(a1)
  1613.     swap    d1
  1614.     move.w    d1,2(a1)
  1615.  
  1616.     move.l    a1,a2
  1617.     add.l    #rotcop.bck1ntsc-rotcop.1,a2
  1618.     move.l    a1,a3
  1619.     add.l    #rotcop.end1ntsc-rotcop.1,a3
  1620.     move.l    a1,a4
  1621.     add.l    #rotcop.bck1-rotcop.1,a4
  1622.  
  1623.     cmp.b    #50,var_ntsc(a0)    ;ntsc/pal frequence
  1624.     bne    rot.ntsc
  1625.  
  1626.     move.l    #$8a01fffe,(a2)        ;reset ntsc split
  1627.     move.l    #$0001fffe,(a3)        ;reset ntsc end
  1628.     add.l    #rotcop.bck1-rotcop.1,a1
  1629.     move.l    #$c201fffe,d0
  1630.     bra    rot.split
  1631. rot.ntsc
  1632.     move.l    #$c201fffe,(a4)        ;reset pal split
  1633.     move.l    #$00880000,(a3)        ;set ntsc end
  1634.     add.l    #rotcop.bck1ntsc-rotcop.1,a1
  1635.     move.l    #$8a01fffe,d0
  1636.  
  1637. rot.split
  1638.     move.l    #$00880000,(a1)        ;set break
  1639.     move.l    var_cprbck(a0),a2
  1640.     cmp.b    #$ff,(a2)        ;menu uit ?
  1641.     bne    rot.cont
  1642.     move.l    d0,(a1)
  1643. rot.cont
  1644.     movem.l    (sp)+,d0-d7/a0-a6
  1645.  
  1646.     bsr    rotcol
  1647.  
  1648.     sub.l    a0,a0            ;geen pic
  1649.  
  1650.     move.l    rotchp-rot(a5),a1
  1651.     add.l    #rotcop.1-rotc,a1    ;copperlist
  1652.     move.l    a1,d1
  1653.     add.l    rotbuf-rot(a5),d1
  1654.     eor.l    #rotcop.2-rotcop.1,rotbuf-rot(a5)
  1655.  
  1656.     movem.l    (sp)+,d2-d7/a2-a6
  1657.     rts
  1658.  
  1659. rotfil
  1660.     movem.l    d0-d7/a0-a6,-(sp)
  1661.     move.l    rotchp-rot(a5),a1
  1662.     add.l    #rotcop.col1-rotc,a1    ;copperlist
  1663.     add.l    rotbuf-rot(a5),a1
  1664.     move.l    #$01800000,d1
  1665.  
  1666.     lsr.w    #8,d0            ;wich colorregister ?
  1667.     tst.b    d0
  1668.     beq    rotfil.a
  1669.     move.l    #$01820000,d1
  1670. rotfil.a
  1671.     cmp.l    8(a1),d1        ;goed gevuld ?
  1672.     beq    rotfil.end
  1673.  
  1674.     move.w    #$1a,d6
  1675.     move.w    #cop_hgt-1,d5
  1676. rotfil.c
  1677.     move.l    #$0001fffe,(a1)+
  1678.     move.b    d6,-4(a1)
  1679.     move.l    #$01060000,(a1)+
  1680.     move.l    d1,(a1)+
  1681.     move.l    #$01060200,(a1)+
  1682.     move.l    d1,(a1)+
  1683.     move.l    #$00d9fffe,(a1)+
  1684.     move.b    d6,-4(a1)
  1685.     add.w    #1,d6
  1686.     dbra    d5,rotfil.c
  1687.  
  1688. rotfil.end
  1689.     movem.l    (sp)+,d0-d7/a0-a6
  1690.     rts
  1691.  
  1692. rotcol
  1693.     movem.l    d0-d7/a0-a6,-(sp)
  1694.  
  1695.     tst.l    var_cols1(a0)        ;new colorset ?
  1696.     beq    rotcol.d
  1697.     move.l    var_cols1(a0),a1
  1698.     cmp.l    #'COLS',(a1)        ;still exists ?
  1699.     bne    rotcol.d
  1700.     move.l    a1,rotcolset-rot(a5)
  1701. rotcol.d
  1702.     tst.l    rotcolset-rot(a5)
  1703.     beq    rotcol.end
  1704.     move.l    rotcolset-rot(a5),a1
  1705.     cmp.l    #'COLS',(a1)        ;still exists ?
  1706.     bne    rotcol.end
  1707.  
  1708.     clr.l    d1
  1709.     cmp.b    #0,d0            ;scroll ?
  1710.     beq    rotcol.e
  1711.  
  1712.     move.l    rotcolpos-rot(a5),d1
  1713.  
  1714.     cmp.b    #1,d0
  1715.     beq    rotcol.up
  1716.     cmp.b    #2,d0
  1717.     beq    rotcol.down
  1718.     cmp.b    #3,d0
  1719.     beq    rotcol.up2
  1720.     cmp.b    #4,d0
  1721.     beq    rotcol.down2
  1722.     bra    rotcol.e
  1723.  
  1724. rotcol.up
  1725.     ifnd    ocs
  1726.     add.l    #4,d1
  1727.     endc
  1728.     ifd    ocs
  1729.     add.l    #2,d1
  1730.     endc
  1731.     bra    rotcol.chk
  1732. rotcol.down
  1733.     ifnd    ocs
  1734.     sub.l    #4,d1
  1735.     endc
  1736.     ifd    ocs
  1737.     add.l    #2,d1
  1738.     endc
  1739.     bra    rotcol.chk
  1740. rotcol.up2
  1741.     ifnd    ocs
  1742.     add.l    #8,d1
  1743.     endc
  1744.     ifd    ocs
  1745.     add.l    #4,d1
  1746.     endc
  1747.     bra    rotcol.chk
  1748. rotcol.down2
  1749.     ifnd    ocs
  1750.     sub.l    #8,d1
  1751.     endc
  1752.     ifd    ocs
  1753.     add.l    #4,d1
  1754.     endc
  1755.     bra    rotcol.chk
  1756.  
  1757. rotcol.chk
  1758.     ifnd    ocs
  1759.     cmp.l    #256*4,d1
  1760.     endc
  1761.     ifd    ocs
  1762.     cmp.l    #256*2,d1
  1763.     endc
  1764.     blt    rotcol.chk2
  1765.     ifnd    ocs
  1766.     sub.l    #256*4,d1
  1767.     endc
  1768.     ifd    ocs
  1769.     sub.l    #256*2,d1
  1770.     endc
  1771. rotcol.chk2
  1772.     cmp.l    #0,d1
  1773.     bge    rotcol.chk3
  1774.     ifnd    ocs
  1775.     add.l    #256*4,d1
  1776.     endc
  1777.     ifd    ocs
  1778.     add.l    #256*2,d1
  1779.     endc
  1780. rotcol.chk3
  1781.     move.l    d1,rotcolpos-rot(a5)
  1782.  
  1783. rotcol.e
  1784.     move.l    rotchp-rot(a5),a2
  1785.     add.l    #rotcop.col1-rotc,a2
  1786.     add.l    rotbuf-rot(a5),a2
  1787.  
  1788.  
  1789.     move.w    4(a1),d0
  1790.     lea    6(a1),a1
  1791.     move.l    a1,a3
  1792.     move.l    a1,a4
  1793.     ifnd    ocs
  1794.     add.l    #4*256,a3
  1795.     endc
  1796.     ifd    ocs
  1797.     add.l    #2*256,a3
  1798.     endc
  1799.     add.l    d1,a1
  1800.     add.l    #((vew_hgt-256)/2)*6*4,a2
  1801. rotcol.a
  1802.     move.w    (a1)+,10(a2)
  1803.     ifnd    ocs
  1804.     move.w    (a1)+,18(a2)
  1805.     endc
  1806.     cmp.l    a3,a1
  1807.     bne    rotcol.f
  1808.     move.l    a4,a1
  1809. rotcol.f
  1810.     lea    6*4(a2),a2
  1811.     dbra    d0,rotcol.a
  1812.     
  1813. rotcol.end
  1814.     movem.l    (sp)+,d0-d7/a0-a6
  1815.     rts
  1816.  
  1817. rotchp        dc.l    0
  1818. rotbuf        dc.l    0
  1819. rotcolset    dc.l    0
  1820. rotcolpos    dc.l    0
  1821.  
  1822. rotp.e
  1823.  
  1824.     SECTION    4,CODE_c
  1825.  
  1826.     cnop    0,8
  1827. rotc
  1828.     ifd    ocs
  1829.     dc.l    'ROTO'
  1830.     endc
  1831.     ifnd    ocs
  1832.     dc.l    'ROTA'
  1833.     endc
  1834.     rts
  1835.     cnop    0,8
  1836.  
  1837. rotcop.1
  1838. rotcop.jmp1
  1839.     dc.w    $0080,$0000,$0082,$0000
  1840. rotcop.col1
  1841.     ds.b    112*6*4
  1842. rotcop.bck1ntsc
  1843.     ds.b    56*6*4
  1844. rotcop.bck1
  1845.     ds.b    62*6*4
  1846. rotcop.end1ntsc
  1847.     ds.b    56*6*4
  1848. rotcop.end1
  1849.     dc.w    $0088,$0000
  1850.  
  1851. rotcop.2
  1852.     dc.w    $0080,$0000,$0082,$0000
  1853.     ds.b    112*6*4
  1854.     ds.b    56*6*4
  1855.     ds.b    62*6*4
  1856.     ds.b    56*6*4
  1857.     dc.w    $0088,$0000
  1858.  
  1859.  
  1860. rotc.e
  1861. rot.e
  1862.  
  1863. ;**********************************************************************
  1864.  
  1865.     ifd    rout
  1866.     cnop    0,8
  1867. rotset
  1868.     incbin    'w:effectaga/Rainbow_256.set'
  1869.     endc
  1870.